package cn.stronglink.asset.module.assetmanage.itasset.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.baomidou.mybatisplus.plugins.Page;

import cn.stronglink.asset.module.assetmanage.itasset.service.ItassetSearchService;
import cn.stronglink.asset.module.assetmanage.itasset.vo.ItAssetVo;
import cn.stronglink.suite.core.base.AbstractController;

@Controller
@RequestMapping(value = "assetSearch")
public class ItassetSearchController extends AbstractController{

	@Autowired
	private ItassetSearchService itassetSearchService;
	
	/**
	 * 动态查询资产列表
	 * @param modelMap
	 * @param request
	 * @param response
	 * @param params
	 * @return
	 */
	@RequestMapping(value = "dynamicQueryAssetList")
	public ResponseEntity<ModelMap> dynamicQueryAssetList(ModelMap modelMap, HttpServletRequest request,
			HttpServletResponse response, @RequestBody Map<String, Object> params) {	
		@SuppressWarnings("unchecked")
		Page<ItAssetVo> page = (Page<ItAssetVo>) super.getPage(params);
		Page<ItAssetVo> data = itassetSearchService.dynamicQueryAssetList(page,params);
		return setSuccessModelMap(modelMap, data);
	}
	
}
